import { App } from 'vue'
import 'element-plus/dist/index.css'

import {
  ElButton,
  ElTabs,
  ElTabPane,
  ElForm,
  ElInput,
  ElFormItem,
  ElIcon,
  ElLink,
  ElCheckbox,
  ElContainer,
  ElHeader,
  ElMain,
  ElAside,
  ElMenu,
  ElMenuItem,
  ElMenuItemGroup,
  ElSubMenu,
  ElCol,
  ElRow,
  ElSelect,
  ElOption,
  ElDatePicker,
  ElDropdown,
  ElAvatar,
  ElDropdownMenu,
  ElDropdownItem,
  ElBreadcrumb,
  ElBreadcrumbItem,
  ElTable,
  ElTableColumn,
  ElConfigProvider,
  ElPagination,
  ElImage,
  ElDialog,
  ElTree,
  ElInputNumber,
  ElCard
} from 'element-plus'
import {
  UserFilled,
  Iphone,
  Goods,
  ChatLineRound,
  Monitor,
  Setting,
  Fold,
  Expand,
  CircleClose,
  Search
} from '@element-plus/icons-vue'

//用到的组件
const components = [
  ElButton,
  ElTabs,
  ElTabPane,
  ElForm,
  ElInput,
  ElFormItem,
  ElIcon,
  UserFilled,
  Iphone,
  ElLink,
  ElCheckbox,
  ElContainer,
  ElHeader,
  ElMain,
  ElAside,
  ElMenu,
  ElMenuItem,
  ElMenuItemGroup,
  ElSubMenu,
  Goods,
  ChatLineRound,
  Monitor,
  Setting,
  Fold,
  Expand,
  ElCol,
  ElRow,
  ElSelect,
  ElOption,
  ElDatePicker,
  ElDropdown,
  ElAvatar,
  ElDropdownMenu,
  ElDropdownItem,
  CircleClose,
  ElBreadcrumb,
  ElBreadcrumbItem,
  ElTable,
  ElTableColumn,
  Search,
  ElConfigProvider,
  ElPagination,
  ElImage,
  ElDialog,
  ElTree,
  ElInputNumber,
  ElCard
]
//遍历全局注册组件
export default function (app: App): void {
  for (const component of components) {
    app.component(component.name, component)
  }
}
